package com.nuumoblie.bluetoothtools.ble.db.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;

import java.util.UUID;

@Entity(indices = {@Index("product_id")},foreignKeys = @ForeignKey(entity = BleProductTypeEntity.class,
        parentColumns = "_id",
        childColumns = "product_id"),tableName = "ble_service")
public class BleServiceEntity {

    @PrimaryKey(autoGenerate = true)
    private int _id;

    @ColumnInfo(name = "product_id")
    private int mProductId;

    @ColumnInfo(name = "uuid")
    private UUID mUuid;

    @ColumnInfo(name = "value")
    private String mValue;

    @ColumnInfo(name = "service_type")
    private int mServiceType;

    @ColumnInfo(name = "write_type")
    private int mWriteType;

    public BleServiceEntity(int mProductId, UUID mUuid, String mValue, int mServiceType, int mWriteType) {
        this.mProductId = mProductId;
        this.mUuid = mUuid;
        this.mValue = mValue;
        this.mServiceType = mServiceType;
        this.mWriteType = mWriteType;
    }

    public int get_id() {
        return _id;
    }

    public void set_id(int _id) {
        this._id = _id;
    }

    public int getProductId() {
        return mProductId;
    }

    public void setProductId(int mProductId) {
        this.mProductId = mProductId;
    }

    public UUID getUuid() {
        return mUuid;
    }

    public void setUuid(UUID mUuid) {
        this.mUuid = mUuid;
    }

    public String getValue() {
        return mValue;
    }

    public void setValue(String mValue) {
        this.mValue = mValue;
    }

    public int getServiceType() {
        return mServiceType;
    }

    public void setServiceType(int mServiceType) {
        this.mServiceType = mServiceType;
    }

    public int getWriteType() {
        return mWriteType;
    }

    public void setWriteType(int mWriteType) {
        this.mWriteType = mWriteType;
    }
}
